package com.cskaoyan.javase.oop2._1extends._5hierarchy;

import javax.rmi.CORBA.Stub;

/**
 * 完善补充一下"=="
 *
 * @since 09:33
 * @author wuguidong@cskaoyan.onaliyun.com
 */
public class Demo2 {
    public static void main(String[] args) {
        System.out.println(123 == 'a');
        int[] arr = new int[3];
        int[] arr2 = new int[4];
        System.out.println(arr == arr2);

        double[] arr3 = new double[3];
        // System.out.println(arr == arr3);

        Student s1 = new Student();
        Student s2 = new Student();
        System.out.println(s1 == s2);
        Teacher t = new Teacher();
        // System.out.println(t == s1);

        // 不同类型的引用实际上也是可以用"=="连接的
        // 两个引用的类型之间只要存在继承关系，那么就可以用"=="连接
        Object o = new Student();
        System.out.println(o == s1);

        StudentSon ss = new StudentSon();
        System.out.println(ss == s1);
    }
}
class Student{}
class StudentSon extends Student{}
class Teacher{}